//---------------------------------------------------------------------------
#ifndef CTEditH
#define CTEditH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <DBCtrls.hpp>
#include <dsgnintf.hpp>
#include "CTreeX.h"
#include "CTChoice.h"
#include <ImgList.hpp>
//---------------------------------------------------------------------------
class TTreeEditor : public TForm
{
__published:	// Composants gérés par l'EDI
    TGroupBox *GroupBox1;
    TBitBtn *BtnAjouterElementt;
    TBitBtn *BtnAjouterSousElement;
    TBitBtn *BtnSupprimer;
    TGroupBox *GroupInformations;
    TEdit *ScrName;
    TLabel *Label1;
    TCheckBox *ScrVisible;
    TCheckBox *ScrEnabled;
    TTreeView *ScrTree;
    TRadioGroup *ScrWinStyle;
    TLabel *Label2;
    TLabel *ScrTag;
    TLabel *Label3;
    TLabel *ScrTagParent;
    TLabel *Label4;
    TEdit *ScrDefineName;
    TLabel *Label5;
    TEdit *Edit1;
    TUpDown *ScrTagMenu;
    TLabel *Label6;
    TSpeedButton *ScrMoveUp;
    TSpeedButton *ScrMoveDown;
    TSpeedButton *ScrChoice;
    TCheckBox *ScrCreation;
    TLabel *Label8;
    TEdit *ScrKeyField;
    TEdit *ScrListField;
    TLabel *Label9;
    TLabel *Label10;
    TEdit *ScrClassName;
    TCheckBox *ScrModeBit7;
    TCheckBox *ScrModeBit6;
    TCheckBox *ScrModeBit5;
    TCheckBox *ScrModeBit4;
    TCheckBox *ScrModeBit3;
    TCheckBox *ScrModeBit2;
    TCheckBox *ScrModeBit1;
    TCheckBox *ScrModeBit0;
    TLabel *Label11;
    TImageList *ImgLstTree;
    TBitBtn *BtnQuitter;
    TCheckBox *ScrBarElmSuiv;
    TEdit *ScrFieldName;
    TLabel *Label12;
    TCheckBox *ScrContList;
    TEdit *edPath;
    TLabel *Label7;
    TLabel *ScrVersion;
    TEdit *Edit2;
    TUpDown *ScrLettre;
    TLabel *Label13;
    TRadioGroup *rbSize;
    TCheckBox *cbRedim;
  TComboBox *cbIcons;
  TLabel *Label14;
  TCheckBox *ScrModeBit15;
  TCheckBox *ScrModeBit14;
  TCheckBox *ScrModeBit13;
  TCheckBox *ScrModeBit12;
  TCheckBox *ScrModeBit11;
  TCheckBox *ScrModeBit10;
  TCheckBox *ScrModeBit9;
  TCheckBox *ScrModeBit8;
    void __fastcall BtnAjouterElementtClick(TObject *Sender);
    void __fastcall ScrNameChange(TObject *Sender);
    void __fastcall BtnAjouterSousElementClick(TObject *Sender);
    void __fastcall BtnSupprimerClick(TObject *Sender);
    void __fastcall ScrVisibleClick(TObject *Sender);
    void __fastcall ScrEnabledClick(TObject *Sender);
    void __fastcall ScrWinStyleClick(TObject *Sender);
    void __fastcall ScrDefineNameChange(TObject *Sender);
    void __fastcall ScrTagMenuClick(TObject *Sender, TUDBtnType Button);
    void __fastcall ScrMoveUpClick(TObject *Sender);
    void __fastcall ScrMoveDownClick(TObject *Sender);
    void __fastcall ScrChoiceClick(TObject *Sender);
    void __fastcall ScrCreationClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall ScrKeyFieldChange(TObject *Sender);
    void __fastcall ScrListFieldChange(TObject *Sender);
    void __fastcall ScrTreeChange(TObject *Sender, TTreeNode *Node);
    void __fastcall ScrClassNameChange(TObject *Sender);
    void __fastcall ScrModeBit7Click(TObject *Sender);
    void __fastcall ScrTreeDragOver(TObject *Sender, TObject *Source,
          int X, int Y, TDragState State, bool &Accept);
    void __fastcall ScrTreeDragDrop(TObject *Sender, TObject *Source,
          int X, int Y);
    void __fastcall BtnQuitterClick(TObject *Sender);
    void __fastcall ScrBarElmSuivClick(TObject *Sender);
    void __fastcall ScrFieldNameChange(TObject *Sender);
    void __fastcall ScrTreeCollapsing(TObject *Sender, TTreeNode *Node,
          bool &AllowCollapse);
    void __fastcall ScrContListClick(TObject *Sender);
    void __fastcall edPathDblClick(TObject *Sender);
    void __fastcall edPathExit(TObject *Sender);

    void __fastcall ScrLettreClick(TObject *Sender, TUDBtnType Button);
    
    void __fastcall Edit2Change(TObject *Sender);
  void __fastcall cbIconsDrawItem(TWinControl *Control, int Index,
          TRect &Rect, TOwnerDrawState State);
  void __fastcall cbIconsClick(TObject *Sender);
private:	// Déclarations de l'utilisateur
    CTree           *m_pWindowView;
    TPropertyEditor *m_PropEditor;
    bool             m_DisplayInfos;
    int              m_OldTag;
    int              m_NewTag;

    void __fastcall DisplayInformations(void);
    int  __fastcall FindIndexTag(int Tag);
    void __fastcall ReplaceTag(int newTag, int oldTag);
    void __fastcall RegenerateTags(void);
    void __fastcall OrganizeDatas(void);

    void __fastcall Enable_SCR_CURELMT(void);
    void __fastcall Enable_SCR_MENU(void);
    void __fastcall Enable_SCR_AFFICH_L(void);
    void __fastcall Enable_SCR_LISTE(void);
    void __fastcall Enable_SCR_SAISIE_L(void);
public:		// Déclarations de l'utilisateur
    __fastcall TTreeEditor(TComponent* Owner);
    void __fastcall InitCTreeEditor(CTree *pwview, TPropertyEditor *PropEdit);
};
//---------------------------------------------------------------------------
//extern TTreeEditor *TreeEditor;
//---------------------------------------------------------------------------
#endif
